%{
#include "hcparser.tab.h"
#include "hcstring.h"
#include "hccodenode.h"
#include "hcconstnode.h"
%}

%option outfile="hcscanner.c"
%option prefix="hc"
%option nounput
%option noinput
%option noyywrap
%%

(var) { return VAR; }
(\() { return RBRAO; }
(\)) { return RBRAC; }
(:) { return COLON; }
(;)	{ return SEMICOLON; }
(=) { return ASSIGN; }
(\,) { return COMMA; }
(\.) { return DOT; }
[0-9]+ {
        hcstring* text = hcstring_create(hctext);
        hclval.codenode = (hccodenode*) hcconstnode_create(text, CONST_INTEGER);
        return CONSTANT;
     }
[a-zA-Z_]([a-zA-Z_]|[0-9])* {
                hcstring* text = hcstring_create(hctext);
                hclval.codenode = hccodenode_create(NODE_IDENTIFIER, text);
                return IDENTIFIER;
              }
[ \t\n]+ {}
